package org.example.business.feign;

import org.example.business.feign.fallback.GoodsFeignFallback;
import org.example.entity.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "xa-goods", path = "goods", fallback = GoodsFeignFallback.class)
public interface GoodsFeign {

    @GetMapping("/goods/{id}")
    Goods queryById(@PathVariable("id") Long id);

    @GetMapping("/goods/reduceGoods")
    String reduceGoods(@RequestParam("id") Long id, @RequestParam("amount") Integer amount);
}
